#pragma once
#include <list>
#include <mutex>
#include <QThread>
#include "IVideoCall.h"
#include "XDecodeThread.h"
struct AVPacket;
struct AVCodecParameters;
class XDecode;
class XVideoThread:public XDecodeThread
{
public:
	//解码pts,如果接受到的解码数据pts  >= seekpts ，返回true,并且显示画面
	virtual bool RepaintPts(AVPacket *pkt, long long seekpts);
	virtual bool Open(AVCodecParameters *para, IVideoCall *call, int width, int height);
	void run();
	XVideoThread();
	virtual ~XVideoThread();
	//同步时间，由外部传入
	long long synpts = 0;
	void SetPause(bool isPause);
	bool Pause = false;
	
protected:
	std::mutex videomux;
	IVideoCall *call = 0;
};

